package com.xiaoq.manager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.xiaoq.manager.entity.MerchantRoleEntity;
import com.xiaoq.manager.repository.IMerchantRoleRepository;
import com.xiaoq.manager.service.IMerchantRoleService;

@Component
public class MerchantRoleServiceImpl implements IMerchantRoleService{
	
	@Autowired
	private IMerchantRoleRepository merchantRoleRep;

	@Override
	public MerchantRoleEntity findMerchantRole(String code) {
		
		return merchantRoleRep.findMerchantRole(code);
	}

	@Override
	public List<MerchantRoleEntity> findMerchantRole() {
		
		return merchantRoleRep.findMerchantRole();
	}

	@Override
	public List<MerchantRoleEntity> findMerchantRoleBySitesId(String sitesId) {
		return merchantRoleRep.findMerchantRoleBySitesId(sitesId);
	}

	@Override
	public MerchantRoleEntity add(MerchantRoleEntity merchantRole) {
		return merchantRoleRep.add(merchantRole);
	}

	@Override
	public MerchantRoleEntity findById(String id) {
		return merchantRoleRep.findById(id);
	}

	@Override
	public boolean deleteMerchantRole(String roleId) {
		return merchantRoleRep.deleteMerchantRole(roleId);
	}

	@Override
	public boolean findMerchantRoleByRoleName(String roleName,String shopId) {
		return merchantRoleRep.findMerchantRoleByRoleName(roleName,shopId);
	}

}
